home *** CD-ROM | disk | FTP | other *** search
- function levelUp()
- {
- level++;
- if(filledSeats + 2 <= numberOfSeats - 1)
- {
- filledSeats += 2;
- }
- if(noiseFrequency > 50)
- {
- noiseFrequency -= 20;
- }
- }
- function clearScreen()
- {
- removeMovieClip("Game");
- removeMovieClip("Flashlight");
- removeMovieClip("Interface");
- }
- function quietNoisyPeople()
- {
- var _loc2_ = 0;
- while(_loc2_ <= noisyPeople.length - 1)
- {
- thePerson = _root.Game["Seat" + noisyPeople[_loc2_]];
- noisyPeople.splice(_loc2_,1);
- thePerson.gotoAndStop("Ready");
- thePerson.makingNoise = false;
- _loc2_ = _loc2_ + 1;
- }
- }
- function unleashNoise()
- {
- do
- {
- var match = false;
- var _loc2_ = randInt(0,peopleSeated.length - 1);
- thePerson = _root.Game["Seat" + peopleSeated[_loc2_]];
- if(thePerson.makingNoise)
- {
- match = true;
- }
- }
- while(match == true);
-
- noisyPeople.push(peopleSeated[_loc2_]);
- thePerson.gotoAndStop("MakingNoise");
- thePerson.makingNoise = true;
- if(!lightsOn)
- {
- attachMovie("noisecue","NoiseCue" + peopleSeated[_loc2_],getNextHighestDepth());
- theNoiseCue = _root["NoiseCue" + peopleSeated[_loc2_]];
- theNoiseCue._x = thePerson._x;
- theNoiseCue._y = thePerson._y + 20;
- }
- }
- function shush()
- {
- SFX.gotoAndPlay("Shush");
- Game.Player.Clip.gotoAndPlay("Shush");
- var _loc3_ = 0;
- while(_loc3_ <= noisyPeople.length - 1)
- {
- thePerson = _root.Game["Seat" + noisyPeople[_loc3_]];
- if(Game.Player.Clip.Collider.hitTest(thePerson))
- {
- var _loc4_ = 0;
- var _loc2_ = 0;
- while(_loc2_ <= noisyPeople.length - 1)
- {
- otherPerson = _root.Game["Seat" + noisyPeople[_loc2_]];
- if(otherPerson.myType == thePerson.myType)
- {
- _loc4_ = _loc4_ + 1;
- }
- _loc2_ = _loc2_ + 1;
- }
- if(_loc4_ <= 1)
- {
- if(thePerson.myType == 1)
- {
- SFX.gotoAndPlay("StopPhony");
- }
- else if(thePerson.myType == 2)
- {
- SFX.gotoAndPlay("StopCrybaby");
- }
- else if(thePerson.myType == 3)
- {
- SFX.gotoAndPlay("StopSnorer");
- }
- else if(thePerson.myType == 4)
- {
- SFX.gotoAndPlay("StopGobbler");
- }
- else if(thePerson.myType == 5)
- {
- SFX.gotoAndPlay("StopLaugher");
- }
- }
- noisyPeople.splice(_loc3_,1);
- score += shushPointValue;
- thePerson.gotoAndStop("Ready");
- thePerson.makingNoise = false;
- break;
- }
- _loc3_ = _loc3_ + 1;
- }
- }
- function setupTheatre()
- {
- _root.createEmptyMovieClip("Game",1);
- Game._x = 0;
- Game._y = 20;
- Game.attachMovie("player","Player",50);
- var _loc5_ = new Array();
- var _loc7_ = numberOfSeats - filledSeats;
- var _loc2_ = 1;
- while(_loc2_ < _loc7_)
- {
- _loc5_.push(0);
- _loc2_ = _loc2_ + 1;
- }
- _loc2_ = 1;
- while(_loc2_ <= filledSeats)
- {
- _loc5_.push(randInt(1,5));
- _loc2_ = _loc2_ + 1;
- }
- shuffle(_loc5_);
- _loc5_.splice(forceEmptySeat - 1,0,0);
- _loc5_.splice(0,0,0);
- peopleSeated = new Array();
- _loc2_ = 1;
- var _loc4_ = 1;
- while(_loc4_ <= 7)
- {
- var _loc6_ = _root["mazeRow" + _loc4_];
- var _loc3_ = 1;
- while(_loc3_ <= 11)
- {
- if(_loc6_[_loc3_ - 1] == 1)
- {
- Game.attachMovie("seat" + _loc5_[_loc2_],"Seat" + _loc2_,(_loc4_ - 1) * 100 + _loc3_);
- theSeat = Game["Seat" + _loc2_];
- theSeat._x = (_loc3_ - 1) * tileWidth;
- theSeat._y = (_loc4_ - 1) * tileHeight;
- theSeat.myType = _loc5_[_loc2_];
- theSeat.makingNoise = false;
- if(_loc5_[_loc2_] > 0)
- {
- _root.peopleSeated.push(_loc2_);
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc3_ = _loc3_ + 1;
- }
- _loc4_ = _loc4_ + 1;
- }
- }
- function moveAvatar(theClip, theDir)
- {
- theClip.gotoAndStop(theDir);
- var _loc4_ = theClip._x;
- var _loc3_ = theClip._y;
- if(theDir == "up")
- {
- _loc3_ = theClip._y - theClip.moveSpeed;
- }
- else if(theDir == "down")
- {
- _loc3_ = theClip._y + theClip.moveSpeed;
- }
- else if(theDir == "left")
- {
- _loc4_ = theClip._x - theClip.moveSpeed;
- }
- else if(theDir == "right")
- {
- _loc4_ = theClip._x + theClip.moveSpeed;
- }
- if(!checkMazeHit(_loc4_,_loc3_,theDir))
- {
- if(theDir == "up")
- {
- theClip._x = theClip.currentColumn * tileWidth - avatarRadius;
- theClip._y = _loc3_;
- }
- else if(theDir == "down")
- {
- theClip._x = theClip.currentColumn * tileWidth - avatarRadius;
- theClip._y = _loc3_;
- }
- else if(theDir == "left")
- {
- theClip._x = _loc4_;
- theClip._y = theClip.currentRow * tileHeight - avatarRadius;
- }
- else if(theDir == "right")
- {
- theClip._x = _loc4_;
- theClip._y = theClip.currentRow * tileHeight - avatarRadius;
- }
- theClip.moveDir = theDir;
- }
- else
- {
- if(theDir == "up")
- {
- theClip._y = theClip.currentRow * tileHeight - avatarRadius;
- }
- else if(theDir == "down")
- {
- theClip._y = theClip.currentRow * tileHeight - avatarRadius;
- }
- else if(theDir == "left")
- {
- theClip._x = theClip.currentColumn * tileWidth - avatarRadius;
- }
- else if(theDir == "right")
- {
- theClip._x = theClip.currentColumn * tileWidth - avatarRadius;
- }
- theClip.moveDir = null;
- }
- Flashlight._x = theClip._x;
- Flashlight._y = theClip._y;
- }
- function checkMazeHit(destX, destY, theDir)
- {
- var _loc4_ = destX;
- var _loc3_ = destY;
- if(theDir == "up")
- {
- _loc3_ = destY - avatarRadius;
- }
- else if(theDir == "down")
- {
- _loc3_ = destY + avatarRadius;
- }
- else if(theDir == "left")
- {
- _loc4_ = destX - avatarRadius;
- }
- else if(theDir == "right")
- {
- _loc4_ = destX + avatarRadius;
- }
- var _loc5_ = Math.ceil(_loc3_ / tileHeight);
- var _loc2_ = Math.ceil(_loc4_ / tileWidth);
- if(_loc5_ > 0 && _loc5_ <= mazeHeight)
- {
- if(_loc2_ > 0 && _loc2_ <= mazeWidth)
- {
- if(_root["mazeRow" + _loc5_][_loc2_ - 1] == 1)
- {
- return true;
- }
- return false;
- }
- return true;
- }
- return true;
- }
- function decrementTimer()
- {
- if(secondsLeft == 0)
- {
- if(minutesLeft == 0)
- {
- clearInterval(timerCode);
- gotoAndStop("WinLevel");
- play();
- }
- else
- {
- secondsLeft = 59;
- minutesLeft--;
- }
- }
- else
- {
- secondsLeft--;
- }
- }
- function setTimerDigits(theMins, theSecs, theClip)
- {
- minutesText = String(theMins);
- secondsText = String(theSecs);
- if(minutesText.length < 2)
- {
- theClip.mins1 = "";
- theClip.mins2 = minutesText;
- }
- else
- {
- theClip.mins1 = minutesText.substr(0,1);
- theClip.mins2 = minutesText.substr(1,1);
- }
- if(secondsText.length < 2)
- {
- theClip.secs1 = "0";
- theClip.secs2 = secondsText;
- }
- else
- {
- theClip.secs1 = secondsText.substr(0,1);
- theClip.secs2 = secondsText.substr(1,1);
- }
- if(theMins < 10)
- {
- theClip.gotoAndStop("FreakOut");
- }
- else
- {
- theClip.gotoAndStop("Normal");
- }
- }
- function randInt(num0, num1)
- {
- if(arguments.length == 1)
- {
- return Math.round(Math.random() * num0);
- }
- return Math.round(Math.random() * Math.abs(num0 - num1)) + num0;
- }
- function shuffle(theArray)
- {
- i = 0;
- while(i < theArray.length - 1)
- {
- var _loc2_ = Math.round(Math.random() * i);
- var _loc3_ = theArray[i];
- theArray[i] = theArray[_loc2_];
- theArray[_loc2_] = _loc3_;
- i++;
- }
- return theArray;
- }
- stop();
- fscommand("allowscale",false);
- funcHITBOX = function(arEvent, arAction)
- {
- getURL("javascript: _hbLink (\'/flash/" + arEvent + "/" + arAction + "ΓÇÖ)","");
- };
-